﻿using System.IO;
namespace CoreEx.Common.Compression
{
    /// <summary>
    /// Represents a class that is capable of compressing and decompressing 
    /// files and streams.
    /// </summary>
    public interface ICompressor
    {
        /// <summary>
        /// Compresses the <paramref name="inputStream"/> and outputs the result in the <paramref name="outputStream"/>.
        /// </summary>
        /// <param name="inputStream">The stream to compress.</param>
        /// <param name="outputStream">The stream containing the result of the compression.</param>
        void Compress(Stream inputStream, Stream outputStream);

        /// <summary>
        /// Compresses the <paramref name="inputFile"/> and outputs the result in the <paramref name="outputFile"/>.
        /// </summary>
        /// <param name="inputFile">The file to compress.</param>
        /// <param name="outputFile">The file containing the result of the compression.</param>
        void Compress(string inputFile, string outputFile);


        /// <summary>
        /// Decompresses the <paramref name="inputFile"/> and outputs the result in the <paramref name="outputFile"/>.
        /// </summary>
        /// <param name="inputFile">The file to decompress.</param>
        /// <param name="outputFile">The file containing the result of the compression.</param>
        void Decompress(string inputFile, string outputFile);


        /// <summary>
        /// Decompresses the <paramref name="inputStream"/> and outputs the result in the <paramref name="inputStream"/>.
        /// </summary>
        /// <param name="inputStream">The file to decompress.</param>
        /// <param name="outputStream">The file containing the result of the compression.</param>
        void Decompress(Stream inputStream, Stream outputStream);

        /// <summary>
        /// Creates a compress <see cref="Stream"/> that wraps around the <paramref name="stream"/> parameter.
        /// </summary>
        /// <param name="stream">The <see cref="Stream"/> to compress.</param>
        /// <returns><see cref="Stream"/></returns>
        Stream CreateCompressorStream(Stream stream);

        /// <summary>
        /// Creates a decompress <see cref="Stream"/> that wraps around the <paramref name="stream"/> parameter.
        /// </summary>
        /// <param name="stream">The <see cref="Stream"/> to decompress.</param>
        /// <returns><see cref="Stream"/></returns>
        Stream CreateDecompressorStrem(Stream stream);

    }
}
